﻿using OpenChart.Entities;

namespace OpenChart.Check
{
    class LineChartChecking:AbsChecking
    {
        protected override void CheckChartTypeSpecificException()
        {
            if (this.ChartArea.Data.Rows.Count <= 1)
            {
                throw new ChartException("折线图的中数据必须至少有两条");//一条数据画不出线
            }
            if (this.ChartArea.AxisX.MinVAlue != null && this.ChartArea.AxisX.MaxValue != null)
            {
                if (this.ChartArea.AxisX.MinVAlue.Value == this.ChartArea.AxisX.MaxValue.Value)
                {
                    throw new ChartException("折线图中X轴的最大值不能等于最小值");
                }
            }
        }
    }
}
